package redis.listener.demo;

import org.springframework.data.redis.connection.Message;
import org.springframework.data.redis.connection.MessageListener;
import org.springframework.stereotype.Component;

/**
 * @author linzp
 * @version 1.0.0
 * CreateDate 2021/1/29 9:10
 */
@Component
public class RedisReceiver implements MessageListener {

    @Override
    public void onMessage(Message message, byte[] bytes) {
        System.out.println("进来了回调方法！");
        System.out.println("回调的信息 message==" + message.toString());
        System.out.println("回调的信息 topic==" + new String(message.getChannel()));
    }
}
